package sanrenxing.dayEnd.backRepertoryTotal.dao;


import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import sanrenxing.dayEnd.backRepertoryTotal.domain.UseMoney;

import java.util.List;

/**
 * 功能:
 * 编写者：
 * 日期：2021
 * 版本：1.0
 */
public interface UseMoneyDao {
    /**
     * 根据证券代码删除一行
     *
     * @param seId
     * @return
     */
    @Delete("delete from useMoney where seId=#{seId}")
    public int delete(@Param("seId") String seId);

    /**
     * 分页查询条件
     *
     * @param start
     * @param rows
     * @param condition
     * @return
     */
    @Select("select ss.seId,si.seName,ss.sumMoney,ss.dates from securitiesStock ss join securitiesInfomation si on ss.seId=si.seId")
    public List<UseMoney> findByPage(@Param("start") int start, @Param("rows") int rows, @Param("condition") String condition);

    /**
     * 按条件统计记录数
     *
     * @param condition 统计条件
     * @return 条件
     */
    @Select("select count(*) from securitiesStock ss join securitiesInfomation si on ss.seId=si.seId where 1=1 ${condition}")
    public int count(@Param("condition") String condition);
}
